(function (fruit, util, global) {

    fruit.ui.define("fruit.graphic.Topology.Sidebar", fruit.ui.Tab, {
        view: function () {
            var root = this.$();
            root.props.class += " f-generalTopology-sidebar";
            this.$('content').props.style = {
                "max-height": '{#height}'
            };
            this.$('content').props.maxHeight = '{#height}';
        },
        properties: {
            height: {
                value: null,
                observable: true
            }
        },
        methods: {
            //hello
            onInit: function () {
                this.inherited();
                this.listen("height", function (sender, args) {
                    var height = args.newValue - 15;
                    /*this.$("content").children(function (child) {
                     child.setStyle("maxHeight", height);
                     });*/
                }, this);
            },

            active: function (index) {
                var prevActivatedItem = this.activatedItemIndex();
                this.inherited(index);

                if (index == null && prevActivatedItem == -1) {
                    this.inactive();
                } else if (index != null && prevActivatedItem == index) {
                    this.inactive();
                }
            }

        }
    });

})(fruit, fruit.util, fruit.global);
